using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Runtime.Serialization;
using ServiceMReviewer.Model;

namespace ServiceMReviewer.DTO
{
	/// <summary>
	/// Data transfer object which is associated with FoodType table in database
	/// </summary>
	[DataContract]
	public class FoodTypeDTO
	{
		[DataMember]
		public int ID { get; set; }
		[DataMember]
		public string Name { get; set; }

        public static FoodTypeDTO Translate(FoodType Entity)
        {
            if (Entity != null)
            {
                var dto = new FoodTypeDTO
                {
                    ID = Entity.ID,
                    Name = Entity.Name,
                };
                return dto;
            }
            return null;
        }

        public static FoodType Reverse(FoodTypeDTO obj)
        {
            var entity = new FoodType
            {
                Name = obj.Name
            };
            return entity;
        }

        public void UpdateEntity(ref FoodType entity)
        {
            entity.Name = Name;
        }
	}
}